Fix alignment when listing jails with more than one IP address #691
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When a VNET jail has more than IP address configured on its primary interface, invoking
bastille list -a
will now display all addresses vertically aligned. This is to address a misalignment issue where the fields following the ip addresses were no longer in the same line as the jail name.For instance:
With this change, all additional IPs for a given jail are aligned vertically, and the fields following the IP (ports, hostname, release, path) are all in the same line as the jail name:
Considerations
Grouping of IPs
Initially I attempted to use line-drawing characters to visualize the fact that all addresses belong to the same jail:
While the result was making it clear to the user where the extra line comes from, the implementation became unnecessarily complex. More importantly, it meant that if anyone parses the output of
bastille list -a
in their script, would have to account for the fact that the "primary" IP address would be in either the third or fourth field of the line.This highlights the fact that with this, the first and second/third/etc addresses will still be on different fields. The first address will be on field number 3, while the following addresses will be on field number 1. I could potentially modify the output to put some dummy characters in the first two columns, although I'm not sure that I like the result. Let me know if something like the following is preferable.
Dependencies
No new dependencies were introduced.